import 'package:healthy_station_flutter/generated/json/base/json_convert_content.dart';
import 'package:healthy_station_flutter/entity/diag_info_entity.dart';

DiagInfoEntity $DiagInfoEntityFromJson(Map<String, dynamic> json) {
  final DiagInfoEntity diagInfoEntity = DiagInfoEntity();
  final String? diseaseName = jsonConvert.convert<String>(json['diseaseName']);
  if (diseaseName != null) {
    diagInfoEntity.diseaseName = diseaseName;
  }
  final String? icd = jsonConvert.convert<String>(json['icd']);
  if (icd != null) {
    diagInfoEntity.icd = icd;
  }
  return diagInfoEntity;
}

Map<String, dynamic> $DiagInfoEntityToJson(DiagInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['diseaseName'] = entity.diseaseName;
  data['icd'] = entity.icd;
  return data;
}

extension DiagInfoEntityExtension on DiagInfoEntity {
  DiagInfoEntity copyWith({
    String? diseaseName,
    String? icd,
  }) {
    return DiagInfoEntity()
      ..diseaseName = diseaseName ?? this.diseaseName
      ..icd = icd ?? this.icd;
  }
}